home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 January / PCWorld_2007-01_cd.bin / v cisle / autoit / autoit-v3.2.0.1-setup.exe / Examples / Helpfile / TraySetIcon.au3 < prev    next >
Text File  |  2006-06-17  |  411b  |  22 lines

  1. #Include <Constants.au3>
  2. #NoTrayIcon
  3.  
  4. Opt("TrayMenuMode",1)    ; Default tray menu items (Script Paused/Exit) will not be shown.
  5.  
  6. $exititem        = TrayCreateItem("Exit")
  7.  
  8. TraySetState()
  9.  
  10. $start = 0
  11. While 1
  12.     $msg = TrayGetMsg()
  13.     If $msg = $exititem Then ExitLoop
  14.     $diff = TimerDiff($start)
  15.     If $diff > 1000 Then
  16.         TraySetIcon("Shell32.dll",Random(0,100,1))
  17.         $start = TimerInit()
  18.     EndIF
  19. WEnd
  20.  
  21. Exit
  22.